//
//  RateDetail.m
//  NiuBanJinGold
//
//  Created by Billy on 15/11/20.
//  Copyright © 2015年 zzjr. All rights reserved.
//

#import "RateDetail.h"

@implementation RateDetail

- (instancetype)initWithAttributes:(NSDictionary *)attributesDic  {
    
    self = [super init];
    
    if (self) {
        
        if ([attributesDic[@"colorType"] integerValue] == 1) {
            
            self.rateType = RateTypeBlue;
            
        }else if([attributesDic[@"colorType"] integerValue] == 2) {
            
            self.rateType = RateTypeYellow;
        }else if([attributesDic[@"colorType"] integerValue] == 3) {
            
            self.rateType = RateTypeOrange;
        }else if([attributesDic[@"colorType"] integerValue] == 4) {
            
            self.rateType = RateTypeRed;
        } else if ([attributesDic[@"colorType"] integerValue] > 4){ //不是已知的颜色统一弄成橙色暂时
            
            self.rateType = RateTypeOrange;
        }
        
        self.rate_number_value = [attributesDic objectForKey:@"rate"];
        self.rate_expiredDate = [attributesDic objectForKey:@"gmtExpire"]; //状态
    }
    
    return self;
}

@end
